<template>
  <div>
    <TopFilter :list="topFilterList" :cols="1" :collapse="false" :isSubmitBtn="false"> </TopFilter>
    <div style="margin: 0 auto; text-align: center">
      <el-button @click="closeDialog">取 消</el-button>
    </div>
  </div>
</template>

<script>
import { queryClaimNo } from '@/api/repair/repairReception/repairBusinessManger';
import { constants } from 'crypto';
export default {
  name: 'claimModel',
  props: ['list'],
  data() {
    return {
      topFilterList: this.createTopFilterList()
    };
  },
  mounted() {
    this.queryClaimNo();
  },
  methods: {
    createTopFilterList() {
      return [
        {
          type: 'INPUT',
          label: '工单号',
          fieldName: 'roNo'
        },
        {
          type: 'INPUT',
          label: '索赔单号',
          fieldName: 'claimNo'
        }
      ];
    },

    // 获取选中行的roNo
    async queryClaimNo() {
      let roNo = this.list[0].RO_NO;
      let params = {
        roNo
      };
      // console.log(params)
      const res = await queryClaimNo(params);
      this.topFilterList[0].initialValue = roNo;
      this.topFilterList[1].initialValue = res.data;
    },
    closeDialog() {
      this.$emit('closeDialog');
    }
  }
};
</script>

<style lang="less" scoped></style>
